package com.example.picturebacked.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.picturebacked.api.aliyunai.model.CreateOutPaintingTaskResponse;
import com.example.picturebacked.model.dto.picture.*;
import com.example.picturebacked.model.entity.Picture;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.picturebacked.model.entity.User;
import com.example.picturebacked.model.vo.PictureVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * @author lbt
 * @description 针对表【picture(图片)】的数据库操作Service
 * @createDate 2025-08-20 14:56:26
 */
public interface PictureService extends IService<Picture> {

    /**
     * 用户图片上传
     */
    PictureVO uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest, User userLogin);

    /**
     * 分页查询接口
     */
    QueryWrapper<Picture> getQueryWrapepr(PictureQueryRequest pictureQueryRequest);

    /**
     * 获取图片封装类，并同时给图片加入创建用户的信息
     *
     * @param picture
     * @param request
     * @return
     */
    PictureVO getPictureVO(Picture picture, HttpServletRequest request);

    /**
     * 分页获取图片封装
     *
     * @param picturePage
     * @param request
     * @return
     */
    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage, HttpServletRequest request);

    /**
     * 图片数据校验方法
     *
     * @param picture
     */
    void validPicture(Picture picture);

    /**
     * 图片审核
     *
     * @param pictureReviewRequest
     * @param userLogin
     */
    void doPictureReview(PictureReviewRequest pictureReviewRequest, User userLogin);

    /**
     * 补充审核参数
     */
    void fillReviewParams(Picture picture, User loginUser);

    /**
     * 批量抓取图片
     */
    Integer uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, User userLogin);

    /**
     * 删除对象
     */
    void clearPictureFile(Picture oldPicture);

    /**
     * 校验空间图片的权限
     */
    void checkPictureAuth(Picture picture, User userLogin);


    /**
     * 删除图片
     */
    void deletePicture(Long pictureId, User userLogin);

    /**
     * 图片编辑
     *
     * @param pictureEditRequest
     * @param userLogin
     */
    void editPicture(PictureEditRequest pictureEditRequest, User userLogin);

    /**
     * 获取与输入颜色相似度最高的空间中的图片
     */
    List<PictureVO> searchPictureByColor(Long spaceId, String pictureColor, User loginUser);

    /**
     * 批量修改图片命名
     */
    void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User userLogin);

    /**
     * 创建扩图方法
     */
    CreateOutPaintingTaskResponse createPictureOutPaintingTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest, User userLogin);
}
























